package com.lanou.remember.controller;

import com.lanou.k12.entity.ResultObject;
import com.lanou.remember.service.IRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

@Api("复习功能")
@RestController
@RequiresAuthentication
@RequestMapping(method = RequestMethod.POST)
public class RecordController {

    @Autowired
    IRecordService service;

    @RequestMapping("/remind")
    @ApiOperation(value = "复习提醒", notes = "根据当前用户信息返回用户需复习的内容数量")
    public ResultObject remind() {
        return service.remind();
    }

    @RequestMapping("/findRecord")
    @ApiOperation(value = "复习进度", notes = "返回用户当前已学习，了解，熟悉，理解，掌握内容数量")
    public ResultObject findRecord() {
        return service.findRecord();
    }

    @RequestMapping("/addReview")
    @ApiOperation(value = "新增一条复习记录", notes = "返回用户当前已学习，了解，熟悉，理解，掌握内容数量")
    public ResultObject addReview(int qid) {
        return service.addRecord(qid);
    }

    @RequestMapping("/updateRecord")
    @ApiOperation(value = "修改复习次数", notes = "根据uid和qid修改复习次数review")
    public ResultObject updateRecord(int qid) {
        return service.updateRecord(qid);
    }



}
